<?php
include_once '../data/database_dal.php';

class MaterialDAL extends DatabaseDAL
{
    function update($id, $rfqID, $type, $qty, $ciNumber, $tradeName, $polymers, $processing,
                    $application, $specialEffect, $specialEquipment, $inTime, $inUser)
    {
        echo $specialEquipment;
        $this->connect();
        $result = $this->mysqli->query("call pr_material_update('". $id ."', '". $rfqID ."', '". $type ."', '". $qty ."', '". $ciNumber ."',
                                                       '". $tradeName ."', '". $polymers ."', '". $processing ."', '". $application ."', '". $specialEffect ."', '". $specialEquipment ."', '". $inTime ."', '". $inUser ."')");
        $this->close();
        return $result;
    }

    function get($where)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_material_get(".'"'. $where .'"'.")");
        $this->close();
        return $result;
    }

    function getAll($orderBy)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_material_get(".'"'. $orderBy .'"'.")");
        $this->close();
        return $result;
    }

    function delete($id)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_material_delete('". $id ."')");
        $this->close();
        return $result;
    }
}

?>
